﻿#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main() {
    ifstream fin("example.txt");
    if (!fin) {
        cerr << "无法打开文件用于读取\n";
        return 1;
    }

    string line;
    while (getline(fin, line)) {      // 一行一行读
        cout << "读取内容: " << line << endl;
    }

    fin.close();
    return 0;
}
